package com.zshan.clinic.admin.entity.medical.dispense.base;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.zshan.clinic.admin.entity.medical.dispense.RxDrugDispense;
import com.zshan.clinic.admin.entity.medical.dispense.RxInfusionDispense;
import com.zshan.clinic.admin.entity.medical.dispense.RxTcmDispense;
import lombok.Data;

/**
 * 配药单
 * @author lichen
 */
@Data
@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,  // 使用字段名称来标识
        property = "rxType",  // 使用 rxType 字段来决定子类类型
        visible = true
)
@JsonSubTypes({
        @JsonSubTypes.Type(value = RxDrugDispense.class, name = "1"),
        @JsonSubTypes.Type(value = RxInfusionDispense.class, name = "2"),
        @JsonSubTypes.Type(value = RxTcmDispense.class, name = "3"),
})
public class RxDispenseBase {

    /** 处方ID */
    private Long rxId;

    /** 处方名;成药处方一 */
    private String rxName;

    /** 处方类型 rxTypeEnum*/
    private String rxType;

    /** 药库ID */
    private Long storageId;

    /**
     * 药库名称
     */
    private String storageName;

    /**
     * 配药状态 dispenseStatusEnum
     */
    private String dispenseStatus;

    @JsonIgnore
    private String rxJson;
}
